import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;

/**
 * 实现 Callable 接口, 重写 call 方法
 */
public class ThreadExample3 implements Callable {
    @Override
    public Object call() throws Exception {
        for (int i = 0; i < 10; i++) {
            System.out.println("After darkness comes light~");
        }
        return null;
    }

    public static void main(String[] args) {
        ThreadExample3 threadExample3 = new ThreadExample3();
        FutureTask<Object> futureTask = new FutureTask<>(threadExample3);
        Thread thread = new Thread(futureTask);
        thread.start();
    }
}
